<!DOCTYPE html>
<!-- 
这是新委托案件库页面，用于管理和展示所有新委托的案件信息。
功能包括：案件搜索、案件列表展示、委托人签字、案件取号等操作。
页面包含各种状态的案件：待领导确认、待委托书签字、待取号、流程中等。
-->
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI新委托案件库</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background: #f5f5f5;
            color: #333;
            min-height: 100vh;
        }

        /* 主内容区 */
        .main-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            overflow-y: auto;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ddd;
            position: relative;
        }

        .page-title-container {
            display: flex;
            align-items: center;
        }

        .back-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            background: #3498db;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            margin-right: 15px;
            cursor: pointer;
            transition: all 0.3s;
            text-decoration: none;
            font-size: 18px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .back-btn:hover {
            background: #2980b9;
            transform: translateX(-3px);
        }

        .page-title {
            font-size: 24px;
            font-weight: bold;
        }

        .user-info {
            display: flex;
            align-items: center;
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
            background: #3498db;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        .user-name {
            font-weight: bold;
        }

        /* 搜索框 */
        .search-container {
            background: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            margin-bottom: 20px;
        }

        .search-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
        }

        .search-form {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            font-size: 14px;
        }

        .form-input, .form-select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .form-input:focus, .form-select:focus {
            border-color: #3498db;
            outline: none;
            box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
        }

        .date-range {
            display: flex;
            align-items: center;
        }

        .date-range input {
            flex: 1;
        }

        .date-separator {
            margin: 0 10px;
            color: #7f8c8d;
        }

        .search-actions {
            grid-column: 1 / -1;
            display: flex;
            justify-content: center;
            margin-top: 10px;
        }

        .search-btn {
            background: #3498db;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            margin-right: 10px;
        }

        .search-btn:hover {
            background: #2980b9;
        }

        .reset-btn {
            background: #95a5a6;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .reset-btn:hover {
            background: #7f8c8d;
        }

        /* 案件列表 */
        .case-list {
            background: white;
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            overflow: hidden;
        }

        .case-list-header {
            background: #f8f9fa;
            padding: 15px 20px;
            border-bottom: 1px solid #ddd;
            font-weight: bold;
            display: flex;
            align-items: center;
        }

        .case-list-title {
            flex: 1;
            font-size: 18px;
        }

        .case-filter {
            display: flex;
            align-items: center;
        }

        .filter-label {
            margin-right: 10px;
            font-size: 14px;
        }

        .filter-select {
            padding: 5px 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .case-table {
            width: 100%;
            border-collapse: collapse;
        }

        .case-table th,
        .case-table td {
            padding: 15px 20px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }

        .case-table th {
            font-weight: bold;
            background: #f8f9fa;
        }

        .case-table tr:hover {
            background: #f5f5f5;
        }

        /* 状态标签 */
        .status-tag {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
        }

        .status-invalid {
            background: #f1c40f;
            color: #7f8c8d;
        }

        .status-waiting-sign {
            background: #e74c3c;
            color: white;
        }

        .status-waiting-number {
            background: #3498db;
            color: white;
        }

        .status-processing {
            background: #2ecc71;
            color: white;
        }

        .status-waiting-submit {
            background: #f39c12;
            color: white;
        }

        /* 新增：待领导确认状态样式 */
        .status-waiting-confirm {
            background: #f39c12; /* 橙色，与 status-waiting-submit 类似，表示等待 */
            color: white;
        }

        /* 操作按钮 */
        .btn {
            display: inline-block;
            padding: 6px 12px;
            margin-right: 5px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            border: none;
        }

        .btn-primary {
            background: #3498db;
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-success {
            background: #2ecc71;
            color: white;
        }

        .btn-success:hover {
            background: #27ae60;
        }

        /* 新增按钮样式 */
        .btn-info {
            background: #17a2b8;
            color: white;
        }

        .btn-info:hover {
            background: #138496;
        }

        /* 分页 */
        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }

        .page-item {
            width: 35px;
            height: 35px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #ddd;
            margin: 0 5px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .page-item:hover {
            border-color: #3498db;
            color: #3498db;
        }

        .page-item.active {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            overflow: auto;
        }

        .modal-content {
            background-color: #fefefe;
            margin: 10% auto;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            width: 500px;
            max-width: 90%;
            position: relative;
        }

        .close-btn {
            position: absolute;
            right: 20px;
            top: 15px;
            font-size: 24px;
            font-weight: bold;
            cursor: pointer;
            color: #aaa;
        }

        .close-btn:hover {
            color: #333;
        }

        .modal-title {
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ddd;
            font-size: 18px;
        }

        .signature-container {
            margin-bottom: 20px;
        }

        .signature-canvas {
            border: 1px dashed #ddd;
            width: 100%;
            height: 150px;
            margin-bottom: 10px;
            background: #f9f9f9;
        }

        .signature-actions {
            display: flex;
            justify-content: flex-end;
        }

        .clear-btn {
            background: #95a5a6;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            margin-bottom: 15px;
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid #eee;
        }

        .form-btn {
            padding: 8px 15px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            border: none;
            margin-left: 10px;
        }

        .cancel-btn {
            background: #95a5a6;
            color: white;
        }

        .cancel-btn:hover {
            background: #7f8c8d;
        }

        .submit-btn {
            background: #2ecc71;
            color: white;
        }

        .submit-btn:hover {
            background: #27ae60;
        }

        /* 取号弹窗样式 */
        .refresh-btn {
            position: absolute;
            right: 10px;
            top: 32px;
            background: #3498db;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
        }

        .search-appraiser {
            display: flex;
            margin-bottom: 10px;
        }

        .search-appraiser .form-input {
            flex: 1;
            margin-right: 10px;
        }

        .search-appraiser .search-btn {
            background: #3498db;
            color: white;
            border: none;
            padding: 5px 15px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
        }

        .appraiser-list {
            max-height: 200px;
            overflow-y: auto;
            margin-bottom: 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }

        .appraiser-table {
            width: 100%;
            border-collapse: collapse;
        }

        .appraiser-table th,
        .appraiser-table td {
            padding: 10px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }

        .appraiser-table th {
            background: #f8f9fa;
            font-weight: bold;
        }

        .appraiser-table tr:hover {
            background: #f5f5f5;
        }

        .status-free {
            color: #2ecc71;
            font-weight: bold;
        }

        .status-busy {
            color: #e74c3c;
            font-weight: bold;
        }

        .add-appraiser-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            padding: 8px;
            background: #f8f9fa;
            border: 1px dashed #ddd;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .add-appraiser-btn:hover {
            background: #ecf0f1;
        }

        .add-icon {
            margin-right: 5px;
            font-size: 16px;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <!-- 主内容区 -->
    <div class="main-content">
        <div class="header">
            <div class="page-title-container">
                <a href="AI文书首页.html" class="back-btn">←</a>
                <div class="page-title">新委托案件库</div>
            </div>
            <div class="user-info">
                <div class="user-avatar">A</div>
                <div class="user-name">管理员</div>
            </div>
        </div>

        <!-- 搜索框 -->
        <div class="search-container">
            <div class="search-title">案件搜索</div>
            <form class="search-form">
                <div class="form-group">
                    <label class="form-label">案件类型</label>
                    <select class="form-select">
                        <option value="">全部</option>
                        <option value="clinical">临床鉴定</option>
                        <option value="death">死亡鉴定</option>
                        <option value="medical">医疗损害</option>
                    </select>
                </div>
                <div class="form-group">
                    <label class="form-label">委托人信息</label>
                    <input type="text" class="form-input" placeholder="姓名/手机号/身份证号">
                </div>
                <div class="form-group">
                    <label class="form-label">状态</label>
                    <select class="form-select">
                        <option value="">全部</option>
                        <option value="waiting-confirm">待领导确认</option>
                        <option value="waiting-sign">待委托书签字</option>
                        <option value="waiting-number">待取号</option>
                        <option value="processing">流程中</option>
                    </select>
                </div>
                <div class="form-group">
                    <label class="form-label">委托时间</label>
                    <div class="date-range">
                        <input type="date" class="form-input">
                        <span class="date-separator">至</span>
                        <input type="date" class="form-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">案件编号</label>
                    <input type="text" class="form-input" placeholder="请输入案件编号">
                </div>
                <div class="form-group">
                    <label class="form-label">关键词</label>
                    <input type="text" class="form-input" placeholder="请输入关键词">
                </div>
                <div class="search-actions">
                    <button type="submit" class="search-btn">搜索</button>
                    <button type="reset" class="reset-btn">重置</button>
                </div>
            </form>
        </div>

        <!-- 案件列表 -->
        <div class="case-list">
            <div class="case-list-header">
                <div class="case-list-title">新委托案件列表</div>
            </div>
            <table class="case-table">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>委托人</th>
                        <th>委托类型</th>
                        <th>检验地点</th>
                        <th>委托时间</th>
                        <th>受理日期</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>CASE-2023-101</td>
                        <td>张三</td>
                        <td>临床鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-20 10:30:00</td>
                        <td>2024-03-20 10:30:00</td>
                        <td><span class="status-tag status-waiting-number">待取号</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-102</td>
                        <td>李四</td>
                        <td>死亡鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-19 15:45:00</td>
                        <td>2024-03-19 15:45:00</td>
                        <td><span class="status-tag status-waiting-sign">待委托书签字</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-103</td>
                        <td>王五</td>
                        <td>医疗损害</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-18 09:15:00</td>
                        <td>2024-03-18 09:15:00</td>
                        <td><span class="status-tag status-waiting-number">待取号</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-104</td>
                        <td>赵六</td>
                        <td>临床鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-17 14:20:00</td>
                        <td>2024-03-17 14:20:00</td>
                        <td><span class="status-tag status-waiting-confirm">待领导确认</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-105</td>
                        <td>钱七</td>
                        <td>死亡鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-16 13:00:00</td>
                        <td>2024-03-16 13:00:00</td>
                        <td><span class="status-tag status-processing">流程中</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-106</td>
                        <td>孙八</td>
                        <td>医疗损害</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-15 11:20:00</td>
                        <td>2024-03-15 11:20:00</td>
                        <td><span class="status-tag status-processing">流程中</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-107</td>
                        <td>周九</td>
                        <td>临床鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-14 16:30:00</td>
                        <td>2024-03-14 16:30:00</td>
                        <td><span class="status-tag status-waiting-confirm">待领导确认</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-108</td>
                        <td>吴十</td>
                        <td>死亡鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-13 09:45:00</td>
                        <td>2024-03-13 09:45:00</td>
                        <td><span class="status-tag status-waiting-number">待取号</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-109</td>
                        <td>郑十一</td>
                        <td>医疗损害</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-12 14:15:00</td>
                        <td>2024-03-12 14:15:00</td>
                        <td><span class="status-tag status-waiting-sign">待委托书签字</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                    <tr>
                        <td>CASE-2023-110</td>
                        <td>王十二</td>
                        <td>临床鉴定</td>
                        <td>杭州鉴定所</td>
                        <td>2024-03-11 10:00:00</td>
                        <td>2024-03-11 10:00:00</td>
                        <td><span class="status-tag status-waiting-number">待取号</span></td>
                        <td>
                            <button class="btn btn-primary">详情</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <!-- 分页 -->
        <div class="pagination">
            <div class="page-item">«</div>
            <div class="page-item active">1</div>
            <div class="page-item">2</div>
            <div class="page-item">3</div>
            <div class="page-item">4</div>
            <div class="page-item">5</div>
            <div class="page-item">»</div>
        </div>
    </div>

    <script>
        // 分页切换
        const pageItems = document.querySelectorAll('.page-item');
        pageItems.forEach(item => {
            item.addEventListener('click', function() {
                if (!this.textContent.includes('«') && !this.textContent.includes('»')) {
                    pageItems.forEach(pi => pi.classList.remove('active'));
                    this.classList.add('active');
                }
            });
        });

        // 详情按钮点击事件
        document.addEventListener('click', function(e) {
            if (e.target.classList.contains('btn-primary') && e.target.textContent === '详情') {
                const row = e.target.closest('tr');
                const caseId = row.querySelector('td:first-child').textContent;
                const caseType = row.querySelector('td:nth-child(3)').textContent;
                
                // 特殊处理CASE-2023-110，直接跳转到法院委托页面
                if (caseId === 'CASE-2023-110') {
                    window.location.href = 'AI案件详情-法医临床-法院委托.html?id=' + caseId;
                    return;
                }
                
                // 根据案件类型跳转到不同的详情页面
                if (caseType === '临床鉴定') {
                    window.location.href = 'AI案件详情-法医临床-个人委托.html?id=' + caseId;
                } else if (caseType === '死亡鉴定') {
                    window.location.href = 'AI案件详情-法医病理.html?id=' + caseId;
                } else if (caseType === '医疗损害') {
                    window.location.href = 'AI案件详情-医疗损害.html?id=' + caseId;
                }
            }
        });
    </script>
</body>
</html>